[tests] Add missing jcw-gen project dependency to Java.Base-Tests#1442
Open
jonathanpeppers wants to merge 1 commit into
Open
[tests] Add missing jcw-gen project dependency to Java.Base-Tests#1442jonathanpeppers wants to merge 1 commit into
jonathanpeppers wants to merge 1 commit into
Conversation
Follow-up to 4b9ee55 which fixed the same issue in Hello-Java.Base. The Java.Base-Tests project invokes jcw-gen.dll via the Java.Interop.Sdk targets but did not declare a ProjectReference to tools/jcw-gen/jcw-gen.csproj. Under parallel (-m) builds this can race: Java.Base-Tests's _JavaCreateJcws target runs before jcw-gen.dll has been produced, and dotnet fails with: Could not execute because the specified command or file was not found. * You intended to execute a .NET program, but dotnet-...\bin\Release-net10.0\/jcw-gen.dll does not exist. Observed on https://dev.azure.com/dnceng-public/public/_build/results?buildId=1448024 Add a ReferenceOutputAssembly=false ProjectReference so MSBuild orders jcw-gen ahead of Java.Base-Tests, matching the pattern used by Hello-Java.Base and Java.Interop-Tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a potential MSBuild parallel-build race in Java.Base-Tests by ensuring the jcw-gen tool project is built before the test project attempts to invoke jcw-gen.dll via Java.Interop.Sdk targets.
Changes:
- Add a
ProjectReferencetotools/jcw-gen/jcw-gen.csprojwithReferenceOutputAssembly="false"intests/Java.Base-Tests, matching the established pattern used by otherSdk.targetsconsumers (e.g.,Java.Interop-Tests,Hello-Java.Base).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1418, which fixed the same issue in
Hello-Java.Base.Problem
The
Java.Base-Testsproject invokesjcw-gen.dllvia theJava.Interop.Sdktargets (Sdk.targets#L195) but does not declare aProjectReferencetotools/jcw-gen/jcw-gen.csproj. Under parallel (-m) MSBuild scheduling this races:Java.Base-Tests's_JavaCreateJcwstarget can run beforejcw-gen.dllhas been produced, anddotnetfails with:Observed on the Windows leg of build 1448024. Timestamps in that log show
Java.Base-Testsinvokedjcw-gen.dllat15:54:26, butjcw-gen.dllwasn't produced until15:54:42— 16 seconds later.Fix
Add a
ReferenceOutputAssembly="false"ProjectReferenceso MSBuild ordersjcw-genahead ofJava.Base-Tests, matching the pattern already used byHello-Java.BaseandJava.Interop-Tests.Java.Base-Testsis the only remaining consumer ofSdk.targetsthat was missing this reference.